import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/Home.vue'
import ticket from '../views/ticket.vue'
import ticketDetail from '../views/ticketDetail.vue'
import ticketOrder from '../views/ticketOrder.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: home,
    meta: {
      istrue: true,
      trueIs:true
    }
  },
  // 车票
  {
    path: '/ticket',
    name: 'Tickek',
    component: ticket,
    meta: {
      istrue: true,
    }
  },
  // 车票详情
  {
    path: '/ticketdetail',
    name: 'TickekDetail',
    component: ticketDetail,
    meta: {
      istrue: true,
    }
  },
  // 订单页
  {
    path: '/ticketorder',
    name: 'TickekOrder',
    component: ticketOrder
  },
  // 目的地
  {
    path:'/dest',
    name:'dest',
    component:() => import('../views/dest.vue'),
    meta: {
      istrue: true,
      trueIs:true
    }
  },
  // 演出
  {
    path:'/show',
    name:'show',
    component:() => import('../views/show.vue'),
    meta: {
      trueIs:true
    }
  },
  // 演出列表
  {
    path:'/showList',
    name:'showList',
    component:() => import('../components/showList/showList.vue'),
    meta: {
      trueIs:true
    }
  },
  // 演出详情页
  {
    path:'/showDetail',
    name:'showDetail',
    component:() => import('../components/showList/showDetail.vue'),
  },
  // 演出订单页
  {
    path:'/showOrder',
    name:'showOrder',
    component:() => import('../components/show/orderShow.vue'),
    meta:{
      login: true,
    }
  },
  // 个人中心
  {
    path:'/me',
    name:'me',
    component:() => import('../views/me.vue'),
    meta: {
      trueIs:true,
      login:true
    }
  },
   // 个人订单中心
   {
    path:'/myorder',
    name:'myorder',
    component:() => import('..//components/order/myorder.vue'),
    meta: {
      login:true
    }
  },
  // 个人优惠券
  {
    path:'/myyhq',
    name:'myyhq',
    component:() => import('..//components/order/myyhq.vue'),
    meta: {
      login:true
    }
  },

   // 搜索页面
   {
    path:'/search',
    name:'search',
    component:() => import('../views/search.vue'),
  },  
  // 普通登录
  {
    path:'/login',
    name:'login',
    component:() => import('../views/login.vue'),
  },
  // 手机号登录
  {
    path:'/phoneLogin',
    name:'phoneLogin',
    component:() => import('../components/login/iphoneLogin.vue'),
  },
  // 邮箱登录
  {
    path:'/emailLogin',
    name:'emailLogin',
    component:() => import('../components/login/emailLogin.vue'),
  },
  {
    path:'/register',
    name:'register',
    component:() => import('../views/register.vue'),
  },

  {
    path:'/test',
    component:() => import('../views/text.vue'),
  },
  // 首页详情页
  {
    path:'/home_detail',
    name:'home_detail',
    component:() => import('../views/home_detail.vue'),
    meta: {
      istrue: true
    }
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
